<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width= , initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>
    <div id="contain">
        <input type="text" v-model="firstname">
        <br>
        <input type="text" :value="secondname">
        <br>
        <h1>全名{{firstname.slice(0,3)}}+{{secondname}}</h1>
    </div>

    <script>
        const vm = new Vue({
            el: '#contain',
            data: {
                firstname: '',
                secondname: '',
            }
        });
    </script>
</body>

</html>